<template>
  <div>
    <h1>Parent Component</h1>
    <p>{{ receivedData }}</p>
    <child-component @child-event="handleChildEvent"></child-component>
  </div>
</template>

<script>
import ChildComponent from './ChildComponent.vue';

export default {
  components: {
    ChildComponent
  },
  data() {
    return {
      receivedData: ''
    };
  },
  methods: {
    handleChildEvent(data) {
      this.receivedData = data; // 处理子组件传递的数据
    }
  }
};
</script>